<%--
  Created by IntelliJ IDEA.
  User: 唐东
  Date: 2021/1/13
  Time: 15:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>用户信息</title>
    <style>
        .BigBox	{
            width:800px;
            height:400px;
            border:8px solid #EEEEEE;
            background-color:white;
            margin:auto;
        }
    </style>
</head>
<body>
<div class="BigBox">
    <div style="position: relative">
        <div>
            <div style="display: inline-block;">用户名：</div>
            <div style="display: inline-block;">
                <input type="text" name="userName" />
            </div>
            <div style="float: right">
                <a href="/getUserServlet">
                    <input style="width: 100px;text-align: center;margin-right: 50px" type="button" value="搜索"/>
                </a>
            </div>
        </div>
    </div>
    <div>
        <a href="/regist.jsp">
            <input type="button" value="添加">
        </a>
    </div>

    <div>
        <table style="margin-left: 50px;" border="solid 1px" class="table table-striped table-sm">
            <thead>
            <tr style="text-align: center">
                <td style="width: 100px">Id</td>
                <td style="width: 100px">用户名</td>
                <td style="width: 100px">邮箱</td>
                <td style="width: 100px">地区</td>
                <td style="width: 100px">创建时间</td>
                <td style="width: 200px">操作</td>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${requestScope.users}" var="user">
                <tr>
                    <td style="width: 100px">${user.id}</td>
                    <td style="width: 100px">${user.userName}</td>
                    <td style="width: 100px">${user.email}</td>
                    <td style="width: 100px">
                  <span>${user.province}<span/>
                  <span>${user.city}<span/>
                    </td>
                    <td style="width: 100px">${user.createTime}</td>
                    <td style="width: 200px">
                        <a href="updateUser.jsp">更新</a>
                        <a href="/deleteUserServlet?id=${user.id}">删除</a>
                        <a href="/updatePositionServlet?id=${user.id}">管理职位</a>
                        <a href="/redisServlet?userName=${user.userName}">登录日志</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
